#include "stdafx.h"
#include "TestWindow.h"


DUI_BEGIN_MESSAGE_MAP(TestWindow, WindowImplBase)
	DUI_ON_MSGTYPE(DUI_MSGTYPE_CLICK, OnSysButtonClick)
DUI_END_MESSAGE_MAP()

TestWindow::TestWindow()
{
}


TestWindow::~TestWindow()
{
}


CDuiString TestWindow::GetSkinFile()
{
	return _T("test_skin.xml");
}

LPCTSTR TestWindow::GetWindowClassName()const
{
	return _T("TestWindow");
}


void TestWindow::OnSysButtonClick(TNotifyUI& msg)
{
	CDuiString sCtrlName = msg.pSender->GetName();
	if (sCtrlName == _T("btn_close"))
	{
		SendMessage(WM_SYSCOMMAND, SC_CLOSE, 0);
		return;
	}
}

LRESULT TestWindow::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	bHandled = FALSE;
	return TRUE;
}

LRESULT TestWindow::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	bHandled = FALSE;
	return TRUE;
}
